<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

<div class="am-progress am-progress-striped am-progress-sm am-active ">
    <div class="am-progress-bar am-progress-bar-secondary"  style="width: 10%"></div>
</div>

<a class="am-btn am-btn-primary" href="addStudent.html">添加学生</a>
<table class="am-table">
    <thead>
    <tr>
        <th>学号</th>
        <th>姓名</th>
        <th>性别</th>
        <th>生日</th>
        <th>入学日期</th>
        <th>手机号码</th>
    </tr>
    </thead>
    <tbody>


    {foreach $students as $stu}
    <tr>
        <td>{$stu.stud_id}</td>
        <td>{$stu.stud_name}</td>
        <td>{$stu['stud_sex']}</td>
        <td>{$stu['birth_date']}</td>
        <td>{$stu['entry_date']}</td>
        <td>{$stu['mobile']}</td>
        <td>
            <a href="index.php?a=student&f=edit&id={$stu['stud_id']}" >编辑</a>
            <a href="index.php?a=student&f=delete&id={$stu['stud_id']}" >删除</a>
        </td>
    </tr>
    {/foreach}
    </tbody>
</table>


<ul class="am-pagination am-pagination-centered">



    <li><a href="index.php?a=Student&f=userlist&page=1" >首页</a></li>


<!--判断是否为第一页-->
    {if $page ==1 }
        <li class="am-disabled" ><a href='#' >&laquo;</a></li>
    {else}
        {$prev = $page - 1}
        <li ><a href="index.php?a=Student&f=userlist&page={$prev}">&laquo;</a></li>
    {/if}



    {for $i=3 to 1 step -1}
        {if ($page - $i) < 1 }
            {continue}
        {/if}
        {$ss = ($page - $i)}
        <li><a href='index.php?a=student&f=userlist&page={$ss}' >{$ss}</a></li>
    {/for}

    <li class="am-active"><a href="index.php?a=student&f=userlist&page='{$page}">{$page}</a></li>

    {for $i=1 to 3 }
        {if ($page + $i) > $count_page }
            {break}
        {/if}
        {$ss = ($page + $i)}
        <li><a href='index.php?a=student&f=userlist&page={$ss}' >{$ss}</a></li>
    {/for}


    {$next = $page + 1}
    {if $page == $count_page }
       <li class="am-disabled"><a href="#">&raquo;</a></li>
    {else}
       <li><a href="index.php?a=Student&f=userlist&page={$next}">&raquo;</a></li>
    {/if}

    <li><a href="index.php?a=Student&f=userlist&page={$count_page}">尾页</a></li>


</ul>